﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Engine
{
    public static class EnumExtender
    {
        public static bool Contains(this GameStatement toTest, GameStatement toFind)
        {
            return (toTest&toFind)!=0;
        }

        public static GameStatement Push(this GameStatement statement)
        {
            if (statement != GameStatement.Max)
            {
                var t = (int)statement;
                t <<= 1;
                return (GameStatement) t;
            }
            if (statement == GameStatement.Loading)
            {
                statement++;
            }
            return statement;
        }
    }
}
